import java.util.Scanner;

public class Demo7 {

    public static void main(String[] args) {

        Object lock1 = new Object();

        Thread t1  = new Thread(() -> {
            try {
            synchronized (lock1) {

                lock1.wait();
            }
                System.out.println("t1 jieshu");
            } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }

        });
        Thread t2  = new Thread(() -> {
            try {
                synchronized (lock1) {

                    lock1.wait();
                }
                System.out.println("t2 jieshu");

            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

        });

        Thread t3  = new Thread(() -> {
            try {
                synchronized (lock1) {

                    lock1.wait();
                }
                System.out.println("t3 jieshu");

            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }

        });

        t1.start();
        t2.start();
        t3.start();
        Scanner sc = new Scanner(System.in);
        sc.next();
//        synchronized (lock1) {
//            lock1.notifyAll();
//        }
        synchronized (lock1) {
            lock1.notify();
        }
        synchronized (lock1) {
            lock1.notify();
        }
    }
}
